package org.jeecg.modules.test.seata.order.feign.fallback;

import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.test.seata.order.feign.ProductClient;

import java.math.BigDecimal;

/**
 * 进入fallback的方法 检查是否token未设置
 * @author: jeecg-boot
 */
@Slf4j
public class ProductClientFallback implements ProductClient {

    @Setter
    private Throwable cause;

    @Override
    public BigDecimal reduceStock(Long productId, Integer count) {
        log.error("库存预留扣减失败 {}", cause);
        return null;
    }
}
